<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    //Vue框架提供构造函数---模拟
    function Vue(options){
       //options：配置对象，一个参数（对象）
       //模拟源码:初始化VM
       //初始化VM->需要做很多事情
       //this即为VM
       this.$options  = options;
       //举例子
       this.count = this.$options.data.count;
       this.add = this.$options.methods.add;

    }

    //创建VM
    let VM  = new Vue({
         el:'#app',
         data:{
             count:1
         },
         methods: {
            add(){

            }
         },
         beforeCreate(){
            alert(123);
         }
    });
    //只要new Vue构造函数，VM实例早就有了
    console.log(VM);
</script>